package com.totem.base.enums;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum YesNoEnum {
    YES("YES"),
    NO("NO");
    private final String code;

    YesNoEnum(String code){
        this.code = code;
    }

    public static YesNoEnum byCode(String code) {
        for (YesNoEnum e: YesNoEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
